/**
 * @file   main.cpp
 * @author xingyifan <xingyifan@xingyifan-VirtualBox>
 * @date   Sun Oct  4 17:15:20 2020
 * 
 * @brief  you can get input data from "data", 
 *  this program will show you them at first, 
 *  and then the result of Heapsort,
 *  finally th result of Mergesort.
 */

#include <iostream>
#include "Student.h"

int main(int argc, char *argv[]) {
    int n;
    std::cin >> n;
    
    Student a[n];
    Student *A = a;

    int std_n;
    char major;
    double GPA;
    
    for (int i=0;i<n;i++) {
	std::cin >> std_n;
	std::cin >> major;
	std::cin >> GPA;
        A[i].set(std_n, major, GPA);
    }

    //First
    std::cout << "Student Data:";
    printout(A, n);
    std::cout << std::endl;

    //Second
    sort_m(A, n);
    std::cout << "major sort with Heapsort:";   
    printout(A, n); 
    std::cout << std::endl;

    //Third
    std::cout << "GPA sort with Mergesort:";
    arrange(A, n);
    printout(A, n);
    std::cout << std::endl;
    
    return 0;
}
